<?php
use \PsiFramework\Classes\Util\UI\Printer;
use \PsiFramework\Classes\Util\UI\HTML;

$profile = $response->getAttribute('profile');
?>
<ul>
    <li>
        Fiche :
        <?php echo HTML::link($profile->getName(), 'action=CMS.Show&type=InformationProfile&id='.$profile->getId()); ?>
        <ul>
        <?php
        $parts = $profile->getParts();
        foreach ($parts as $part) {
            $theme = $part->getTheme();
        ?>
            <li>
                Thème :
                <?php echo HTML::link($theme->getName(), 'action=CMS.Show&type=Form&id='.$theme->getId()); ?>
                <ul>
                <?php
                $fieldLinks = $theme->getFields();
                foreach ($fieldLinks as $fieldLink) {
                    $field = $fieldLink->getField();
                ?>
                    <li>
                        Champs :
                        <?php echo HTML::link($field->getName(), 'action=CMS.Show&type=FormField&id='.$field->getId()); ?>
                        <ul>
                            <li>
                                Type de champs :
                                <?php echo HTML::link($field->getType()->getName(), 'action=CMS.Show&type=FieldType&id='.$field->getType()->getId()); ?>
                            </li>
                        </ul>
                    </li>
                <?php
                } 
                ?>
                </ul>
            </li>
        <?php
        }
        ?>
        </ul>
    </li>
</ul>